package com.neo.impatient.C05_Class.C05_08_innerClass

import scala.collection.mutable.ArrayBuffer

class Network {

  class Member(val name: String){
    val contacts = new ArrayBuffer[Member]
  }

  private val member =  new ArrayBuffer[Member]

  def join(name: String) = {
    val m = new Member(name)
    member += m
    m
  }
}

object Network{


  def main(args: Array[String]): Unit = {

    val chartter = new Network
    val myFace = new Network


    val fred  = chartter.join("Fred")
    val wilma = chartter.join("Wilma")

    fred.contacts += wilma
    val barney = myFace.join("Barney")

    //fred.contacts += barney
    //不可以将myFace的Member添加到chartter的Member
    //虽然都叫Member,这里体现出他们是不同的两个类


  }
}